import { postJson, deleteJson, putJson, get } from "@/common/VueAxios"
import type { ApiResult, ApiPageResult, PageInfo } from "./basemodel"

export interface ProjectLog {
    id?: number
    createtime?: string
    project_id?: number
    num?: number
}


export interface ProjectLogSearch extends PageInfo {
    project_id?: number
}

export function removeById(id: number) {
    return remove([id])
}

export function remove(ids?: number[]) {
    return deleteJson<number[] | undefined, ApiResult>("/project/task", ids)
}

export function getLogPage(dto: ProjectLogSearch) {
    return get<PageInfo, ApiPageResult<ProjectLog>>("/project/task/getpage", dto)
}
export function add(project_id?: number) {
    return get<{ project_id?: number }, ApiResult>("/project/task/add", { project_id })
}
export function cancel(project_id?: number) {
    return get<{ project_id?: number }, ApiResult>("/project/task/cancel", { project_id })
}